import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Studentvo } from '../vo/studentvo';

@Injectable()
export class StudentService {

  constructor(private http:HttpClient) { }


  private getAnObjectUrl="http://localhost/getAnObject";

  getAnObject(){

    return this.http.get(this.getAnObjectUrl).toPromise();
  }

  private addStudentInfoUrl="http://localhost/saveStudentInfo";
    addStudentinfo(svo:Studentvo){
      let p={
        "xm":svo.xm,
        "sfzh":svo.sfzh,
        "xh":svo.xh
      }
      return this.http.post(this.addStudentInfoUrl,p).toPromise();
    }
}